
export default class GameDataController {
    //常驻数据储存Controller
    static _instance: GameDataController = null;

    static getInstance(): GameDataController {
        if (!this._instance) {
            this._instance = new GameDataController();
        }

        return this._instance;
    }

    initNewGame(){
        this.CurrLevel = 1;
        this.CurrLeftLifes = 3
        this.CurrScore = 0;
        this.HighScore = 1800000;
    }

    //当前关卡
    private _currLevel = 0;
    get CurrLevel() {
        return this._currLevel;
    }
    set CurrLevel(level: number) {
        this._currLevel = level;
    }

    //当前剩余命数
    private _currLeftLife = 0;
    get CurrLeftLifes() {
        return this._currLeftLife;
    }
    set CurrLeftLifes(lifes: number) {
        this._currLeftLife = lifes;
    }

    //当前分数
    private _currScore = 0;
    get CurrScore() {
        return this._currScore;
    }
    set CurrScore(score: number) {
        this._currScore = score;
    }

    //最高分数
    private _highScore = 0;
    get HighScore() {
        return this._highScore;
    }
    set HighScore(score: number) {
        this._highScore = score;
    }

}
